home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Programming / MiniGL / src / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-07  |  1.6 KB  |  72 lines

  1. /*
  2.  * $Id: init.c,v 1.1.1.1 2000/04/07 19:44:51 tfrieden Exp $
  3.  *
  4.  * $Date: 2000/04/07 19:44:51 $
  5.  * $Revision: 1.1.1.1 $
  6.  *
  7.  * (C) 1999 by Hyperion
  8.  * All rights reserved
  9.  *
  10.  * This file is part of the MiniGL library project
  11.  * See the file Licence.txt for more details
  12.  *
  13.  */
  14.  
  15. #include "sysinc.h"
  16. static char rcsid[] = "$Id: init.c,v 1.1.1.1 2000/04/07 19:44:51 tfrieden Exp $";
  17.  
  18.  
  19. struct Library *UtilityBase;
  20. struct IntuitionBase *IntuitionBase;
  21. struct GfxBase *GfxBase;
  22. #ifndef __PPC__
  23. struct Device *TimerBase = 0;
  24. extern struct DosLibrary *DOSBase;
  25. extern struct ExecBase *SysBase;
  26. #endif
  27. #ifdef __PPC__
  28. struct Library *Warp3DPPCBase = NULL;
  29. #else
  30. struct Library *Warp3DBase = NULL;
  31. #endif
  32. struct Library *CyberGfxBase = NULL;
  33.  
  34.  
  35. void MGLInit(void)
  36. {
  37.     IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 0L);
  38.     GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 0L);
  39.     UtilityBase = OpenLibrary("utility.library", 0L);
  40. #ifdef __PPC__
  41.     Warp3DPPCBase = OpenLibrary("Warp3DPPC.library", 2L);
  42. #else
  43.     Warp3DBase = OpenLibrary("Warp3D.library", 2L);
  44. #endif
  45.     CyberGfxBase = OpenLibrary("cybergraphics.library", 0L);
  46.  
  47. }
  48.  
  49. void MGLTerm(void)
  50. {
  51.     if (CyberGfxBase)       CloseLibrary(CyberGfxBase);
  52.     CyberGfxBase = NULL;
  53.  
  54.     #ifdef __PPC__
  55.     if (Warp3DPPCBase)      CloseLibrary(Warp3DPPCBase);
  56.     Warp3DPPCBase = NULL;
  57.  
  58.     #else
  59.     if (Warp3DBase)         CloseLibrary(Warp3DBase);
  60.     Warp3DBase = NULL;
  61.     #endif
  62.  
  63.     if (IntuitionBase)      CloseLibrary((struct Library *)IntuitionBase);
  64.     IntuitionBase = NULL;
  65.  
  66.     if (GfxBase)            CloseLibrary((struct Library *)GfxBase);
  67.     GfxBase = NULL;
  68.  
  69.     if (UtilityBase)        CloseLibrary(UtilityBase);
  70.     UtilityBase = NULL;
  71. }
  72.